<html>
<head><meta charset="utf-8"><title>How to run tests in error_codes? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20run.20tests.20in.20error_codes.3F.html">How to run tests in error_codes?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="218671677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20run%20tests%20in%20error_codes%3F/near/218671677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> sasurau4 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20run.20tests.20in.20error_codes.3F.html#218671677">(Dec 03 2020 at 09:47)</a>:</h4>
<p>How to run tests like <code>compiler/rustc_error_codes/src/error_codes/E0164.md</code> and annotated code block with <code>compile_fail,E0164</code>?<br>
It seems doc tests and I run <code>./x.py test --doc</code> with must fail annotation, but the command success.</p>



<a name="218715029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20run%20tests%20in%20error_codes%3F/near/218715029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20run.20tests.20in.20error_codes.3F.html#218715029">(Dec 03 2020 at 16:06)</a>:</h4>
<p><span class="user-mention" data-user-id="331219">@sasurau4</span> <code>./x.py test src/tools/error_index_generator</code>   That extracts all the docs into a single markdown file, then runs <code>rustdoc --test</code> on it it.</p>



<a name="218841382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20run%20tests%20in%20error_codes%3F/near/218841382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> sasurau4 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20run.20tests.20in.20error_codes.3F.html#218841382">(Dec 04 2020 at 14:48)</a>:</h4>
<p>Thanks. Addition, <code>rustdoc --test ./build/x86_64-unknown-linux-gnu/test/error-index.md</code> caused  62 fail tests in my local. Because they use feature attribute and emit message like <code>'#![feature]' may not be used on the stable release channel</code>. How to run  doc test same as CI locally?</p>



<a name="218841494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20run%20tests%20in%20error_codes%3F/near/218841494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20run.20tests.20in.20error_codes.3F.html#218841494">(Dec 04 2020 at 14:49)</a>:</h4>
<p><span class="user-mention" data-user-id="331219">@sasurau4</span> you need the same version of rustdoc</p>



<a name="218841515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20run%20tests%20in%20error_codes%3F/near/218841515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20run.20tests.20in.20error_codes.3F.html#218841515">(Dec 04 2020 at 14:49)</a>:</h4>
<p>either beta with RUSTC_BOOTSTRAP or the latest nightly</p>



<a name="218841621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20run%20tests%20in%20error_codes%3F/near/218841621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20run.20tests.20in.20error_codes.3F.html#218841621">(Dec 04 2020 at 14:49)</a>:</h4>
<p>but you can never get the <em>exact</em> version of nightly because the master branch has changes from the last 24 hours, so it's better to use x.py where possible</p>



<a name="218842595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20run%20tests%20in%20error_codes%3F/near/218842595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> sasurau4 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20run.20tests.20in.20error_codes.3F.html#218842595">(Dec 04 2020 at 14:56)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Thanks <span aria-label="thumbs up" class="emoji emoji-1f44d" role="img" title="thumbs up">:thumbs_up:</span>  When I use dev from rustup, rustdoc works fine. I see. <br>
Can I run <code>error-index.md</code> from x.py? The command <code>./x.py test --doc build/x86_64-unknown-linux-gnu/test/error-index.md</code> doesn't succeed.</p>



<a name="218842817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20run%20tests%20in%20error_codes%3F/near/218842817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20run.20tests.20in.20error_codes.3F.html#218842817">(Dec 04 2020 at 14:58)</a>:</h4>
<p>I would not expect anything with build/ at the front to work</p>



<a name="218842844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20run%20tests%20in%20error_codes%3F/near/218842844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20run.20tests.20in.20error_codes.3F.html#218842844">(Dec 04 2020 at 14:58)</a>:</h4>
<p>maybe <code>x.py test compiler/error_index</code> or something like that</p>



<a name="218844944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20run%20tests%20in%20error_codes%3F/near/218844944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> sasurau4 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20run.20tests.20in.20error_codes.3F.html#218844944">(Dec 04 2020 at 15:14)</a>:</h4>
<p>I see. <code>./x.py test compiler/rustc_error_codes</code> run 0 tests and <code>x.py test compiler/error_index</code> fail with no rules matched. <br>
My question is how to check error code in my local and I have understood how to do it. Thanks for your replies!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>